import request from '@/utils/request'

// 查询员工列表
export function listStaff(query) {
  return request({
    url: '/offline/staff',
    method: 'get',
    params: query
  })
}

// 新增员工
export function addStaff(data) {
  return request({
    url: '/offline/staff',
    method: 'post',
    data: data
  })
}

// 员工账号状态修改
export function changeStaffDisabled(id, disabled) {
  const data = {
    disabled
  }
  return request({
    url: `/offline/staff/${id}/disabled`,
    method: 'put',
    data: data
  })
}

// 修改角色
export function updateStaff(id, data) {
  return request({
    url: `/offline/staff/${id}`,
    method: 'put',
    data: data
  })
}
